<<<<<<< HEAD
package com.dat255.tentatime;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;

public class DbHelper extends SQLiteOpenHelper {
	private static final String TAG = DbHelper.class.getSimpleName();
	private static final int DATABASE_VERSION = 1;
	private static final String EXAMLIST_TABLE_NAME = "exams";
	private static final String COL_COURSE_NAME = "Course Name";
	private static final String COL_COURSE_ID = "Course ID";
	private static final String COL_COURSE_TIME = "Time of exam";
	private static final String COL_COURSE_DATE = "Date of exam";
	private static final String COL_COURSE_PLACE = "Place of exam";
	
	private static final String sql = String.format( "create table %s (%s TEXT, %s TEXT primary key, %s TEXT, %s TEXT, %s TEXT)",
			EXAMLIST_TABLE_NAME,COL_COURSE_NAME, COL_COURSE_ID,COL_COURSE_TIME, COL_COURSE_DATE,COL_COURSE_PLACE);
	
	

	public DbHelper(Context context, String name) {
		super(context, name, null,  DATABASE_VERSION);

	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		
		
		db.execSQL(sql);
		
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	
		db.execSQL("drop table if exists"+ EXAMLIST_TABLE_NAME);
		 this.onCreate(db);
		 
		 
		
		
	}

	
}
=======
package com.dat255.tentatime;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;

public class DbHelper extends SQLiteOpenHelper {
	private static final String TAG = DbHelper.class.getSimpleName();
	private static  final int DATABASE_VERSION = 1;
	private static final String EXAMLIST_TABLE_NAME = "exams";
	private static final String COL_COURSE_NAME = "Course Name";
	private static final String COL_COURSE_ID = "Course ID";
	private static final String COL_COURSE_TIME = "Time of exam";
	private static final String COL_COURSE_DATE = "Date of exam";
	private static final String COL_COURSE_PLACE = "Place of exam";
	
	private static final String sql = String.format( "create table %s (%s TEXT, %s TEXT primary key, %s TEXT, %s TEXT, %s TEXT)",
			EXAMLIST_TABLE_NAME,COL_COURSE_NAME, COL_COURSE_ID,COL_COURSE_TIME, COL_COURSE_DATE,COL_COURSE_PLACE);
	
	

	public DbHelper(Context context, String name) {
		super(context, name, null,  DATABASE_VERSION);

	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		
		
		db.execSQL(sql);
		
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	
		db.execSQL("drop table if exists"+ EXAMLIST_TABLE_NAME);
		 this.onCreate(db);
		 
		 
		
		
	}

	
}
>>>>>>> 6dd1aeed1c3b37c10b4c86b442e4ab4550fbbb9d
